const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
let strArr;
rl.on("line", (line)=>{
    if(strArr === undefined) {
        strArr = line.trim().split(",").map(str => str.trim());
        const temp = getResult(strArr)
        console.log(temp)
        strArr = undefined;
    }
})

/**
 *
 * @param strArr {[string]} 输入的字符串数组
 * @returns {BigInt} 输出的结果数字
 */
function getResult(strArr) {
    strArr.sort((a, b)=>{
        let aa = a + b;
        let bb = b + a;
        return aa > bb ? -1 : 1

    }) // 默认升序
    return BigInt(strArr.join(""));
}

